﻿using ICAM.DataLayer;
using ICAM.Model;
using System;
﻿using System;
﻿using ICAM.Model;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;

namespace ICAM
{
    public class DataModule
    {
        public string Message { get; set; }

        public string Num { get; set; }
    }
    public class TestDataInfoVM : ViewModelBase
    {
        public ObservableCollection<TopAlarmStatistics> AlaramInfoColletion { get; set; }
        public ObservableCollection<TopAlarmStatistics> AlaramColletion { get; set; }

        public TestDataInfoVM()
        {
            var data = new DataService();
            var list = data.GetAlarmDistribution();
            var listLoc = data.GetAlarmLocation();
            AlaramInfoColletion = new ObservableCollection<TopAlarmStatistics>();
            AlaramColletion = new ObservableCollection<TopAlarmStatistics>();

            //this.Init();
            //this.InitData();

            foreach (var item in list)
            {
                AlaramInfoColletion.Add(item);
            }
            foreach (var item in listLoc)
            {
                AlaramColletion.Add(item);
            }
        }

        //private void Init()
        //{
        //    DataModule test = new DataModule();
        //    test.Message = "业主家人三天未出小区";
        //    test.Num = "4";
        //    DataModule test1 = new DataModule();
        //    test1.Message = "快递人员长时间未出小区";
        //    test1.Num = "2";
        //    DataModule test2 = new DataModule();
        //    test2.Message = "陌生人逗留";
        //    test2.Num = "1";
        //    DataModule test3 = new DataModule();
        //    test3.Message = "黑名单人员出没";
        //    test3.Num = "1";
        //    AlaramInfoColletion.Add(test);
        //    AlaramInfoColletion.Add(test1);
        //    AlaramInfoColletion.Add(test2);
        //    AlaramInfoColletion.Add(test3);
        //}

        //private void InitData()
        //{
        //    DataModule test = new DataModule();
        //    test.Message = "小区东门";
        //    test.Num = "5";
        //    DataModule test1 = new DataModule();
        //    test1.Message = "B栋2单元";
        //    test1.Num = "3";
        //    DataModule test2 = new DataModule();
        //    test2.Message = "小区南门";
        //    test2.Num = "2";
        //    AlaramColletion.Add(test);
        //    AlaramColletion.Add(test1);
        //    AlaramColletion.Add(test2);
        //}
    }

    public class TestAlaramData
    {
        public string ID { get; set; }
        public string Des { get; set; }
        public string Address { get; set; }

        public string Time { get; set; }

        public string AlaramType { get; set; }

        public int AlaramGrade { get; set; }
    }

    public class TestAlaramInfoVM : ViewModelBase
    {
        public ObservableCollection<AlarmInfo> AlaramCollection { get; set; }

        public TestAlaramInfoVM()
        {
            this.AlaramCollection = new ObservableCollection<AlarmInfo>();

            DataService service = new DataService();
            var list = service.GetAlarmInfo(10);
            foreach (var item in list)
            {
                AlaramCollection.Add(item);
            }
        }
    }



}
